﻿using DigitalHealth.PACS.Appointment.Models;
using System;
using System.Collections.Generic;
using System.Linq;

namespace DigitalHealth.PACS.Appointment.Repositories.Imp
{
    public class ClassOrderRepository : IClassOrderRepository
    {
        public static readonly List<ClassOrder> _classOrderList = new List<ClassOrder>()
        {
            new ClassOrder(){Id=Guid.NewGuid(),Name="测试1",doctorUser=new Common.Users.SysUser(){UserId=1,UserName="test1"} },
            new ClassOrder(){Id=Guid.NewGuid(),Name="测试2",doctorUser=new Common.Users.SysUser(){UserId=1,UserName="test1"} },
            new ClassOrder(){Id=Guid.NewGuid(),Name="测试3",doctorUser=new Common.Users.SysUser(){UserId=1,UserName="test1"} },
            new ClassOrder(){Id=Guid.NewGuid(),Name="测试4",doctorUser=new Common.Users.SysUser(){UserId=1,UserName="test1"} },
        };

        public ClassOrder GetById(string id)
        {
            return _classOrderList.Where(c => c.Id.ToString() == id).FirstOrDefault();
        }

        public List<ClassOrder> GetByPredicate(Predicate<ClassOrder> predicate)
        {
            return _classOrderList.Where(c => { return predicate.Invoke(c); }).ToList();
        }
    }
}
